DateTimeIsDefault Function

public function DateTimeIsDefault(time) result(isDefault)

Check if datetime is set to default

Arguments

Type IntentOptional Attributes Name
type(DateTime), intent(in) :: time

Return Value logical


Source Code

FUNCTION  DateTimeIsDefault &
!
(time) &
!
RESULT (isDefault)

IMPLICIT NONE

! Arguments with intent(in):
TYPE (DateTime), INTENT(IN) :: time

! Local declarations:
LOGICAL :: isDefault

!------------end of declaration------------------------------------------------

IF (time % year == 0 .AND. &
    time % month == 0 .AND. &
    time % day == 0 .AND. &
    time % hour == 0 .AND. &
    time % minute == 0 .AND. &
    time % second == 0 ) THEN
    
    isDefault = .TRUE.
ELSE
    isDefault = .FALSE.
END IF

RETURN

END FUNCTION DateTimeIsDefault